package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HisEngineRuleMedicineMapper;
import com.ruoyi.system.domain.HisEngineRuleMedicine;
import com.ruoyi.system.service.IHisEngineRuleMedicineService;

/**
 * 药物规则Service业务层处理
 *
 * @author Alan
 * @date 2024-03-07
 */
@Service
public class HisEngineRuleMedicineServiceImpl implements IHisEngineRuleMedicineService
{
    @Autowired
    private HisEngineRuleMedicineMapper hisEngineRuleMedicineMapper;

    /**
     * 查询药物规则
     *
     * @param id 药物规则主键
     * @return 药物规则
     */
    @Override
    public HisEngineRuleMedicine selectHisEngineRuleMedicineById(Long id)
    {
        return hisEngineRuleMedicineMapper.selectHisEngineRuleMedicineById(id);
    }

    /**
     * 查询药物规则列表
     *
     * @param hisEngineRuleMedicine 药物规则
     * @return 药物规则
     */
    @Override
    public List<HisEngineRuleMedicine> selectHisEngineRuleMedicineList(HisEngineRuleMedicine hisEngineRuleMedicine)
    {
        return hisEngineRuleMedicineMapper.selectHisEngineRuleMedicineList(hisEngineRuleMedicine);
    }

    /**
     * 新增药物规则
     *
     * @param hisEngineRuleMedicine 药物规则
     * @return 结果
     */
    @Override
    public int insertHisEngineRuleMedicine(HisEngineRuleMedicine hisEngineRuleMedicine)
    {
        hisEngineRuleMedicine.setCreateTime(DateUtils.getNowDate());
        return hisEngineRuleMedicineMapper.insertHisEngineRuleMedicine(hisEngineRuleMedicine);
    }

    /**
     * 修改药物规则
     *
     * @param hisEngineRuleMedicine 药物规则
     * @return 结果
     */
    @Override
    public int updateHisEngineRuleMedicine(HisEngineRuleMedicine hisEngineRuleMedicine)
    {
        return hisEngineRuleMedicineMapper.updateHisEngineRuleMedicine(hisEngineRuleMedicine);
    }

    /**
     * 批量删除药物规则
     *
     * @param ids 需要删除的药物规则主键
     * @return 结果
     */
    @Override
    public int deleteHisEngineRuleMedicineByIds(Long[] ids)
    {
        return hisEngineRuleMedicineMapper.deleteHisEngineRuleMedicineByIds(ids);
    }

    /**
     * 删除药物规则信息
     *
     * @param id 药物规则主键
     * @return 结果
     */
    @Override
    public int deleteHisEngineRuleMedicineById(Long id)
    {
        return hisEngineRuleMedicineMapper.deleteHisEngineRuleMedicineById(id);
    }
}
